home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 1.iso / toolbox / src / exampleCode / opengl / GLUT / lib / fglut / glut_modifier.c < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-11  |  780 b   |  34 lines

  1.  
  2. /* Copyright (c) Mark J. Kilgard, 1994. */
  3.  
  4. /* This program is freely distributable without licensing fees 
  5.    and is provided without guarantee or warrantee expressed or 
  6.    implied. This program is -not- in the public domain. */
  7.  
  8. #include <X11/Xlib.h>
  9.  
  10. #include "glutint.h"
  11.  
  12. /* CENTRY */
  13. int
  14. glutGetModifiers(void)
  15. {
  16.   int modifiers;
  17.  
  18.   if(__glutModifierMask == (unsigned int) ~0) {
  19.     __glutWarning(
  20.       "glutCurrentModifiers: do not call outside core input callback.");
  21.     return 0;
  22.   }
  23.   modifiers = 0;
  24.   if(__glutModifierMask & (ShiftMask|LockMask))
  25.     modifiers |= GLUT_ACTIVE_SHIFT;
  26.   if(__glutModifierMask & ControlMask)
  27.     modifiers |= GLUT_ACTIVE_CTRL;
  28.   if(__glutModifierMask & Mod1Mask)
  29.     modifiers |= GLUT_ACTIVE_ALT;
  30.   return modifiers;
  31. }
  32.  
  33. /* ENDCENTRY */
  34.